package com.changgou.web.filter;

public class UrlFilter {
    //需要拦截的请求地址
    public static String filterPath = "/api/wseckillorder," +
            "/api/seckill," +
            "/api/wxpay," +
            "/api/wxpay/**," +
            "/api/worder/**," +
            "/api/user/**," +
            "/api/address/**," +
            "/api/wcart/**," +
            "/api/cart/**," +
            "/api/categoryReport/**," +
            "/api/orderConfig/**," +
            "/api/order/**," +
            "/api/orderItem/**," +
            "/api/orderLog/**," +
            "/api/preferential/**," +
            "/api/returnCause/**," +
            "/api/returnOrder/**," +
            "/api/returnOrderItem/**";

    public static boolean hasAuthorize (String url) {
        String[] split = filterPath.replace("**", "").split(",");
        for (String s : split) {
            if (url.startsWith(s)) {
                return true;
            }
        }
        return false;
    }
}
